import request from '@/utils/request'
/*
	获取返费列表
	pageNum, pageSize 分页
*/
export function fetchReturnFeeAjax(data) {
    return request({
        url: '/admin/rddReturnfee',
        method: 'get',
        params: { ...data }
    })
}

/*
	创建反费
*/
export function addReturnFeeAjax(data) {
    return request({
        url: '/admin/rddReturnfee',
        method: 'post',
        data: data
    })
}

/*
	获取政策列表
*/
export function fetchPolicyAjax(data) {
    return request({
        url: '/admin/rddPolicy',
        method: 'get',
        params: { ...data }
    })
}

/*
	创建政策
*/
export function addPolicyAjax(data) {
    return request({
        url: '/admin/rddPolicy',
        method: 'post',
        data: data
    })
}

/*
	更新政策
*/
export function updatePolicyAjax(data) {
    return request({
        url: '/admin/rddPolicy/' + data.id,
        method: 'put',
        data: data
    })
}

/*
	删除政策
*/
export function delPolicyAjax(data) {
    return request({
        url: '/admin/rddPolicy/' + data.id,
        method: 'delete'
    })
}
/*
	获取政策详情
*/
export function getPolicyDetailAjax(id) {
    return request({
        url: '/admin/rddPolicy/' + id,
        method: 'get'
    })
}

/*
	创建政策详情规则
*/
export function addPolicyInfoAjax(data) {
    return request({
        url: '/admin/rddPolicyInfo',
        method: 'post',
        data: data
    })
}

/*
	获取推荐反费列表
*/
export function fetchRecommendFeeAjax(data) {
    return request({
        url: '/admin/rddRecommend',
        method: 'get',
        params: { ...data }
    })
}

/*
	获取邀请费用
*/
export function fetchInviteAjax(data) {
    return request({
        url: '/admin/rddSpread',
        method: 'get',
        params: { ...data }
    })
}

/*
	获取邀请费用规则
*/
export function fetchInviteRuleAjax(data) {
    return request({
        url: '/admin/rddSpreadRule/1',
        method: 'get',
        params: { ...data }
    })
}

/*
	更新邀请费用规则
*/
export function updateInviteRuleAjax(data) {
    return request({
        url: '/admin/rddSpreadRule/1',
        method: 'put',
        data: data
    })
}

export function ackStatus(data) {
    return request({
        url: '/admin/rddSpread/' + data.id + '/ackStatus',
        method: 'put'
    })
}

export function exportSpread(data) {
    return request({
        url: '/admin/rddSpread/export',
        method: 'get',
        params: data
    })
}
